home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / drdtips.zip / 1114.TXT < prev    next >
Text File  |  1992-04-13  |  6KB  |  142 lines

  1. Document 1114
  2. SID and DEBUG
  3. 04/13/92
  4. BK
  5.  
  6.                         SID AND THE DEBUG PATCH
  7.  
  8.  
  9. Often software manufacturers will have to make changes to their software
  10. after it has been released to customers.  Usually these are very small
  11. changes to the instructions that make up the software, sometimes only
  12. affecting 1 or 2 bytes out of the entire program.  Since the changes are so
  13. small, they can often be  completed  by  the customer by following a patch
  14. listing  from  the manufacturer. These patch listings depend on the use of
  15. DEBUG.  A typical patch listing will look something like this:
  16.  
  17. 1) COPY BROKFILE.EXE BROKFILE.SAV
  18. 2) DEBUG BROKFILE.EXE
  19. 3) -S 100 L FFFF B2 01 7C 56 8B 1E
  20. 4) -E xxxx:yyyy 91 92 93 94 88 1F
  21. 5) -W
  22. 6) -Q
  23.  
  24. DR  DOS  6.0  has a similar utility called  SID.  While  the function of
  25. the two applications is the same, the actual commands are a little
  26. different. Below is the typical listing  with  the purpose of each step
  27. explained and the SID equivalent  described. The format in each step
  28. explained here is:
  29.  
  30. DEBUG COMMAND LINE
  31.  
  32.           GENERAL COMMENTS AND CLARIFICATION
  33.  
  34.                                    EQUIVALENT SID COMMAND LINE
  35.  
  36.  
  37. 1) COPY BROKFILE.EXE BROKFILE.BAK
  38.  
  39.           Just in case things do not go as planned, make a  back-
  40. up.
  41.  
  42.                               (same command)
  43. 2) DEBUG BROKFILE.EXE
  44.  
  45.           DEBUG is loading and reading the  subject file into
  46.           memory. To accomplish this in SID, type SID at the
  47.           command line and then use the R command to read the
  48.           subject file into memory starting at memory offset
  49.           address 100. SID will display the starting and ending
  50.           address of the file in memory in a SEGMENT:OFFSET
  51.           format. Note these addresses.
  52.  
  53.                                    SID
  54.                                    #RBROKFILE.EXE,100
  55.  
  56. 3) -S 100 L FFFF B2 01 7C 56 8B 1E
  57.           DEBUG is searching from the offset address 100 to
  58.           the last address of FFFF (a hexadecimal number) for the
  59.           pattern of bytes listed (B2 01 7C 56 8B 1E B8). this is
  60.           a pattern that is unique to the area or areas of the
  61.           file that need to be changed. DEBUG will return the
  62.           addresses of the desired patterns in a SEGMENT:OFFSET
  63.           format like 2345:1DF5. The specific values returned
  64.           will vary. There may be more than one found. The patch
  65.           listing will usually refer to these values as
  66.           'xxxx:yyyy'.
  67.                The  SID SR command is very similar. Some  of  the
  68.           arguments are separated with commas instead of  spaces.
  69.           The  address  or  addresses that  contain  the  desired
  70.           pattern will be returned in the same xxxx:yyyy  format.
  71.           Record the addresses returned.
  72.                                    #SR100,FFFF,B2 01 7c 56 8B  1E
  73.  
  74. 4) -E xxxx:yyyy 91 92 93 94 88 1F
  75.  
  76.           DEBUG is entering new values for the bytes in memory.
  77.           This is how the software is actually changed. The
  78.           xxxx:yyyy is the address at which the new values should
  79.           be added. The following numbers are the new values
  80.           themselves. In SID, use the S command and specify where
  81.           the new values should start.
  82.                SID  will  display that starting address  and  the
  83.           current  value  in memory and be waiting  for  the  new
  84.           value. Enter the first value listed after xxxx:yyyy  in
  85.           the -E command line of the patch listing. Press  Enter.
  86.           SID  will  now show the next address  and  its  current
  87.           value and be waiting for the new value. Enter the  next
  88.           value  in  the -E command line. Continue  entering  the
  89.           remaining  values.  After the last value has  been  en-
  90.           tered, SID will display the next address and be waiting
  91.           for  a new value. Simply enter a '.' and  press  ENTER.
  92.           SID will return to its '#' prompt.
  93.                                         #Sxxxx:yyyy
  94.                                         xxxx:yyyy B2 91
  95.                                         xxxx:yyyz 01 92
  96.                                         xxxx:yyya 7C 93
  97.                                         xxxx:yyyb 56 94
  98.                                         xxxx:yyyb 8B 88
  99.                                         xxxx:yyyb 1E 1F
  100.                                         xxxx:yyyb 22 .
  101.                                         #
  102.  
  103. 5) -W
  104.  
  105.           The update version of the software is written from
  106.           memory to the original file name. In SID use the
  107.           W command followed by the filename.
  108.  
  109.                                         #WBROKFILE.EXE
  110.  
  111. 6) -Q
  112.           You're done. Quit. SID's command is the same.
  113.  
  114.                                         #Q
  115. On  the  next page is a sample of what this patch  process  would
  116. look like in SID.
  117.  
  118. [DR DOS] C:\MYFILES>SID
  119. --------------------------------------------------
  120. *** Symbolic Instruction Debugger ***  Release 3.2
  121.       Copyright (c) 1983,1984,1985,1988,1990,1991
  122.     Digital Research, Inc. All Rights Reserved
  123. --------------------------------------------------
  124.  
  125. #RBROKFILE.EXE,100
  126.   Start      End
  127. 1056:0100 2056:7BF2
  128. #SR100,FFFF,B2 01 7C 56 8B 1E
  129. 1056:2344
  130. #S1056:2344
  131. 1056:2344 B2 91
  132. 1056:2345 01 92
  133. 1056:2346 7C 93
  134. 1056:2347 56 94
  135. 1056:2348 8B 88
  136. 1056:2349 1E 1F
  137. 1056:234A B8 .
  138. #WBROKFILE.EXE
  139. #Q
  140.  
  141. [DR DOS] C:\MYFILES>
  142.